import request from '/@/utils/request'
const url = '/api/user'
const User = {
  // 查
  getListApi({ params }: any) {
    return request({
      url,
      method: 'get',
      params,
    })
  },

  // 查详情
  getDetailApi({ url, params }: any) {
    return request({
      url,
      method: 'get',
      params,
    })
  },

  // 查下拉菜单
  getDropDownListApi({ url, params }: any) {
    return request({
      url,
      method: 'get',
      params,
    })
  },

  // 增
  addApi({ url, data }: any) {
    return request({
      url,
      method: 'post',
      data,
    })
  },

  // 改
  editApi({ url, data }: any) {
    console.log(url, data, data.id)
    return request({
      url: url + '/' + data.id,
      method: 'put',
      data,
    })
  },

  // 删
  delApi({ url, id }: any) {
    return request({
      url: url + '/' + id,
      method: 'delete',
    })
  },
}

export default User
